package com.luhuiguo.cms.server.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * 栏目
 * 
 * @author LuHuiguo
 * @version $Id: Channel.java 161 2010-05-07 16:08:12Z luhuiguo@gmail.com $
 */
@Entity
public class Channel implements Serializable {

    private static final long serialVersionUID = -8631260176729009182L;

    /**
     * 标识
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 父栏目标识
     */
    @Basic
    private Long parentId;

    /**
     * 路径
     */
    @Basic
    private String path;

    /**
     * 外部地址
     */
    @Basic
    private String url;

    /**
     * 模板
     */
    @Basic
    private String template;

    /**
     * 文章模板
     */
    @Basic
    private String viewTemplate;

    /**
     * 名称
     */
    @Basic
    private String name;

    /**
     * 标题
     */
    @Basic
    private String title;

    /**
     * 关键字
     */
    @Basic
    private String keywords;

    /**
     * 描述
     */
    @Basic
    private String description;

    /**
     * 排序等级
     */
    @Basic
    private int rank;

    /**
     * 类型
     */
    @Basic
    private int type;

    /**
     * 状态
     */
    @Basic
    private int status;

    /**
     * 允许发表文章
     */
    @Basic
    private boolean allowPost;

    /**
     * 允许浏览栏目
     */
    @Basic
    private boolean allowView;

    /**
     * 允许评论
     */
    @Basic
    private boolean allowComment;

    /**
     * 创建时间
     */
    @Basic
    private Date created;

    /**
     * 创建者
     */
    @Basic
    private String createdBy;

    /**
     * 最后修改时间
     */
    @Basic
    private Date lastModified;

    /**
     * 最后修改者
     */
    @Basic
    private String lastModifiedBy;

    public Channel() {

    }

    public Channel(String name, String title) {
        this.name = name;
        this.title = title;
    }

    public Channel(Long parentId, String path, String name, String title) {
        this.parentId = parentId;
        this.path = path;
        this.name = name;
        this.title = title;

    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    public String getViewTemplate() {
        return viewTemplate;
    }

    public void setViewTemplate(String viewTemplate) {
        this.viewTemplate = viewTemplate;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public boolean isAllowPost() {
        return allowPost;
    }

    public void setAllowPost(boolean allowPost) {
        this.allowPost = allowPost;
    }

    public boolean isAllowView() {
        return allowView;
    }

    public void setAllowView(boolean allowView) {
        this.allowView = allowView;
    }

    public boolean isAllowComment() {
        return allowComment;
    }

    public void setAllowComment(boolean allowComment) {
        this.allowComment = allowComment;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getLastModified() {
        return lastModified;
    }

    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("Channel [id=").append(id).append(", name=").append(name).append(", parentId=").append(parentId)
                .append(", path=").append(path).append(", rank=").append(rank).append(", status=").append(status)
                .append(", title=").append(title).append(", type=").append(type).append("]");
        return builder.toString();
    }

}
